package com.androider.timememory.utils;

import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.telephony.SmsManager;

public class SMSUtil {
	public static final Uri CONTENT_URI = Uri.parse("content://sms");  
	public static final String CONTENT_INBOX = "content://sms/conversations/";
	
	public static final String FILTER = " ";
	
	public static final String ID = "_id";
    public static final String TYPE = "type";  
    public static final String THREAD_ID = "thread_id";  
    public static final String ADDRESS = "address";  
    public static final String PERSON_ID = "person";  
    public static final String DATE = "date";  
    public static final String READ = "read";  
    public static final String BODY = "body";  
    public static final String PROTOCOL = "protocol";  
   
    public static final int MESSAGE_TYPE_ALL    = 0;  
    public static final int MESSAGE_TYPE_INBOX  = 1;  
    public static final int MESSAGE_TYPE_SENT   = 2;  
    public static final int MESSAGE_TYPE_DRAFT  = 3;  
    public static final int MESSAGE_TYPE_OUTBOX = 4;  
    public static final int MESSAGE_TYPE_FAILED = 5; // for failed outgoing messages  
    public static final int MESSAGE_TYPE_QUEUED = 6; // for messages to send later
    
    public static final int MESSAGE_UNREAD = 0;
    public static final int MESSAGE_READ = 1;
     
    public static final int PROTOCOL_SMS = 0;//SMS_PROTO  
    public static final int PROTOCOL_MMS = 1;//MMS_PROTO
    
    public static void SendSMS(String toNo, String content, Context context){
        SmsManager smsManager = SmsManager.getDefault();
        PendingIntent sentIntent = PendingIntent.getBroadcast(context, 0, new Intent(), 0);
        smsManager.sendTextMessage(toNo, null, content, sentIntent, null);
    }
}
